package com.suke.czx.modules.tb.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.math.BigDecimal;


/**
 * 订单表
 *
 * @author developer
 * @email developer@163.com
 * @date 2025-05-19 07:16:43
 */
@Data
@TableName("tb_order_info")
public class TbOrderInfo implements Serializable {
    public static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty(value = "订单ID (主键, 自增)")
    @JsonProperty(value = "id")
    public String id;

    @ApiModelProperty(value = "订单编号 (业务唯一)")
    @JsonProperty(value = "orderSn")
    public String orderSn;

    @ApiModelProperty(value = "商品ID (外键关联tb_product.id)")
    @JsonProperty(value = "productId")
    public Long productId;

    @ApiModelProperty(value = "购买者用户ID (外键关联sys_user.id)")
    @JsonProperty(value = "buyerId")
    public String buyerId;

    @ApiModelProperty(value = "卖家用户ID (外键关联sys_user.id, 冗余)")
    @JsonProperty(value = "sellerId")
    public String sellerId;

    @ApiModelProperty(value = "订单总金额")
    @JsonProperty(value = "totalAmount")
    public BigDecimal totalAmount;

    @ApiModelProperty(value = "订单状态 (如：pending_payment, paid, shipped, completed, cancelled, refunded)")
    @JsonProperty(value = "status")
    public String status;

    @ApiModelProperty(value = "支付方式 (如：wechat_pay)")
    @JsonProperty(value = "paymentMethod")
    public String paymentMethod;

    @ApiModelProperty(value = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "paymentTime")
    public Date paymentTime;

    @ApiModelProperty(value = "支付平台交易号")
    @JsonProperty(value = "transactionId")
    public String transactionId;

    @ApiModelProperty(value = "收货地址 (JSON结构: name, phone, province, city, district, detail)")
    @JsonProperty(value = "shippingAddress")
    public String shippingAddress;

    @ApiModelProperty(value = "买家备注")
    @JsonProperty(value = "remarks")
    public String remarks;

    @ApiModelProperty(value = "取消原因")
    public String cancelReason;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "createDate")
    public Date createDate;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "updateDate")
    public Date updateDate;

    @ApiModelProperty(value = "商品信息json")
    @JsonIgnore
    public String productInfoJson;
}
